package com.samehope.ar.mapper;

import com.samehope.ar.entity.ProblemType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.samehope.ar.vo.FormSelectVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 问题分类表 Mapper 接口
 * </p>
 *
 * @author Zhang Luo
 * @since 2020-01-06
 */
public interface ProblemTypeMapper extends BaseMapper<ProblemType> {

    /**
     * 根据项目加分类查找问题分类
     * @param projectId
     * @param problemTypeId
     * @return
     */
    ProblemType findByProjectAndProblemType(@Param("projectId") Long projectId,
                                            @Param("problemTypeId") Long problemTypeId);

    /**
     * 根据项目和分类名称查找问题分类
     * @param projectId
     * @param name
     * @return
     */
    ProblemType findByProjectAndName(@Param("projectId") Long projectId,
                                     @Param("name") String name);

    /**
     * 问题分类下拉选的视图对象结合
     * @param projectId
     * @return
     */
    List<FormSelectVO> typesForSelectByProject(Long projectId);
}
